<div class="block">
	<div class="hd">
		<h2>Edit Your Profile</h2>
	</div>
	<div class="bd">


<p style="background-color: #fafafa; float: right; width: 100px; margin-left: 20px; font-size: 9px;"><img src="<?='http://www.gravatar.com/avatar.php?size=100&default='.urlencode('/assets/default/images/defaultperson.png')."&gravatar_id=".md5(trim($user->emailaddress));?>" width="100" height="100" /><br />Profile pictures are powered by <a href="http://www.gravatar.com">Gravatar</a>.</p>



<?=form_open('users/profile', array('class' => 'profileForm'));?>

<input type="hidden" class="hidden" name="id" id="id" value="<?= $user->id; ?>" />


<fieldset>
	<h3>Login Information</h3>
		<label class="required">Email address<input type="text" name="emailaddress" id="emailaddress" value="<?= $user->emailaddress; ?>" class="{required:true,email:true}" /></label>
		<label <?php if ($action == 'add'): ?>class="required"<?php endif;?>>Password
			<input type="password" name="password" id="password" class="{<?php if ($action == 'add'): ?>required:true,<?php endif;?>minLength:5}" />
		</label>
		<label <?php if ($action == 'add'): ?>class="required"<?php endif;?>>Confirm Password
			<input type="password" name="confirm-password" id="confirm-password" class="{<?php if ($action == 'add'): ?>required:true,<?php endif;?>equalTo:'#password',minLength:5}" />
		</label>
		
		<label class="">Open Id Identifier<input type="text" name="openid_identifier" id="openid_identifier" value="<?= $user->openid_identifier; ?>" class="" /></label>
</fieldset>

<fieldset>
<h3>Personal Information</h3>
	
		<label for="firstname" class="required">Firstname
		<input type="text" name="firstname" id="firstname" value="<?= $user->firstname; ?>" class="{required:true}" /></label>
		<label for="lastname" class="required">Surname
		<input type="text" name="lastname" id="lastname" value="<?= $user->lastname; ?>" class="{required:true}" /></label>
	
</fieldset>
<?php if ($this->authentication->getProfileType() != 'client'):?>
<fieldset>
	<h3>Notifications</h3>
	
		
		<div class="checkboxes">
		<h5>Notify me when..</h5>
		<label><input type="checkbox" name="notification_type[]" value="assign" <?php if ( in_array( "assign" ,$user->notification_type) == true) echo 'checked="checked"';?> /> I'm assigned to a project</label>
		<label><input type="checkbox" name="notification_type[]" value="project_update"  <?php if ( in_array( "project_update" ,$user->notification_type) == true) echo 'checked="checked"';?>/> An update is made on a project i'm assigned to</label>
		</div>
		
		<h5>Notify me by..</h5>
		<div class="checkboxes">
		<label><input type="checkbox" name="notify_email" value="email" <?php if ($user->notify_email) echo 'checked="checked"';?> /> Email</label>
				<?php /*<label><input type="radio" name="notify_when" value="creation" /> When something happens</label>
				<label><input type="radio" name="notify_when" value="dayend" /> At then end of the day (5.00pm)</label>
				<label><input type="radio" name="notify_when" value="daybegin" /> At then begining of the day (9.00am)</label>
				<label><input type="radio" name="notify_when" value="time" /> At this time every day: <input type="text" name="notify_time" /></label> */?>
		<label><input type="checkbox" name="notify_twitter" value="twitter" <?php if ($user->notify_twitter) echo 'checked="checked"';?> /> Twitter (You must follow <a href="http://twitter.com/epicentr">epicentr</a> for updates)</label>
			</div>
			<label for="twitter_username">Twitter username<input type="text" name="twitter_username" value="<?= $user->twitter_username; ?>" title="Enter your Twitter user name" /></label>

</fieldset>
<?php endif;?>
<input type="submit" name="Submit" value="Save" class="savebutton" />
<br />
<?=form_close();?>

	</div>
</div>

</div>
</div>
</div>

<div id="sidebar" class="yui-b">
		<div class="block">
			<div class="hd">
				<h2></h2>
			</div>
			<div class="bd">
	
			</div>
		</div>
</div>